package com.whcstar.springcloud.eurekaconsumerribbon.controller;

import com.whcstar.springcloud.eurekaconsumerribbon.service.OperateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/operate")
public class OperateController {

    @Autowired
    private OperateService operateService;

    @RequestMapping("/add")
    public Integer add(Integer a, Integer b) {
        return operateService.add(a, b);
    }

    @RequestMapping("/sub")
    public Integer sub(Integer a, Integer b) {
        return operateService.sub(a, b);
    }

}
